package com.riteny.test;

import com.riteny.oauth.core.userauth.CustomUserAuthenticationService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Riteny
 * 2021/5/10  16:27
 */
@Service
public class SimpleUserAuthenticationService implements CustomUserAuthenticationService {

    @Override
    public String searchPassword(String username, String userType) {
        return "$2a$10$u2.TGFJuzx13g1lDXoy.KeUQU8s6/HoqTaHCqWMV8/eeyLUEyYs9W";
    }

    @Override
    public List<String> searchAuthorities(String username, String userType) {

        List<String> strs = new ArrayList<>();
        strs.add("test");

        return strs;
    }

    @Override
    public Map<String, Object> searchUserDetailInfo(String username, String userType) {

        Map<String, Object> map = new HashMap<>();
        map.put("userkey1","uservalue1");
        map.put("userkey2","uservalue2");
        map.put("userkey3","uservalue3");

        return map;
    }
}
